﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Notes.aspx.cs" Inherits="Main_Personal_Notes" 
    
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    
</head>
<body>
     <form id="form1" runat="server">
         <asp:HiddenField ID="txtCurrentUser" runat="server"/>
         <div id="divNotes" style="padding-top:2%">
            <table border="0" cellpadding="0" cellspacing="0" style="width:100%;padding-left: 2%;">
                <tr>
                    <td style="width:50px">
                        <img id="imgLogo" alt="logo" src="images/sidebar_links_bg.gif" />
                    </td>
                    <td align="left">
                        <h1 style="font-size:20px;">Notes</h1>
                    </td>
                </tr>
            </table>
            <img id="imgheaderhr" src="images/links_header_hr.jpg" alt="link header hr"  style="background-repeat:repeat-x; width: 100%; height: 8px;"/>
            <table border="0" width="100%;">
                <tr>
                    <td valign="middle" align="center">
                        <!--This is the main table displayed at the center-->
                        <table style="font-size:100%; width: 100%; background-color:#ffffff" bgcolor="#669999">
                          
                            <tr>
                                <td valign="middle"> 
                                    <table style="vertical-align:middle"">
                                        <tr>
                                            <td>
                                                <img id="Img1" alt="Add Note" src="images/note_add.png" title="Add note" 
                                                    style="height: 20px; width: 20px; cursor:pointer;" onclick="javascript:showNotePopup('Add');"/>                                                           
                                            </td>
                                            <td>
                                                <asp:Label runat="server" style="cursor:pointer" onclick="javascript:showNotePopup('Add');">Add Note        </asp:Label>
                                            </td>
                                            <td style="width:10px"></td>                                        
                                            <td>
                                                <img id="Img2" alt="Edit Note" src="images/note_edit.png" title="Edit note" 
                                                    style="height: 20px; width: 20px; cursor:pointer;" onclick="javascript:showNotePopup('Edit');"/>                                
                                            </td>
                                            <td>
                                                <asp:Label ID="Label1" runat="server" style="cursor:pointer" onclick="javascript:showNotePopup('Edit');">Edit Note        </asp:Label>
                                            </td> 
                                            <td style="width:10px"></td>                                        
                                            <td>
                                                <img id="Img3" alt="Delete Note" src="images/note_delete.png" title="Delete note" 
                                                    style="height: 20px; width: 20px; cursor:pointer;" onclick="javascript:deleteSelectedNote();"/>                                                                   
                                            </td>
                                            <td>
                                                <asp:Label ID="Label2" runat="server" style="cursor:pointer" onclick="javascript:deleteSelectedNote();">Delete Note        </asp:Label>
                                            </td>                                        
                                        </tr>
                                    </table>
                                    
                                    <%--<img id="btnAddNote" alt="Add Note" src="images/note_add.png" title="Add note" 
                                             style="height: 20px; width: 20px; cursor:pointer;" onclick="javascript:showNotePopup('Add');"/>                                
                                   
                                    <img id="btnEditNote" alt="Edit Note" src="images/note_edit.png" title="Edit note" 
                                             style="height: 20px; width: 20px; cursor:pointer;" onclick="javascript:showNotePopup('Edit');"/>                                
                                   
                                    <img id="btnDeleteNote" alt="Delete Note" src="images/note_delete.png" title="Delete note" 
                                             style="height: 20px; width: 20px; cursor:pointer;" onclick="javascript:deleteSelectedNote();"/>                                                                   --%>
                                </td>                                
                            </tr>
                            <tr>
                                <td valign=top style="font-size: 5px">                                
                                   <asp:DataGrid ID="GridView1" 
                                     Width="100%"
                                     runat="server" 
                                     BorderColor="Silver"
                                     GridLines="Vertical"
                                     AutoGenerateColumns="false"
                                     HeaderStyle-BackColor="Silver"
                                     HeaderStyle-Font-Bold="True"
                                     AllowPaging="True"                                     
                                     OnItemDataBound="GridView1_ItemDataBound" >                                    
                                    <Columns>
                                        <asp:BoundColumn DataField="noteID" HeaderText="ID" Visible="false"/>
                                        <asp:BoundColumn ItemStyle-Width="20%" DataField="title" HeaderText="Title"/>
                                        <asp:BoundColumn ItemStyle-Width="40%" DataField="description" HeaderText="Content"/>
                                        <asp:BoundColumn DataField="dateCreated" HeaderText="Date Created"/>
                                        <asp:BoundColumn DataField="lastSaved" HeaderText="Last Saved" />
                                    </Columns>        
                                   </asp:DataGrid>                     
                                </td>                            
                            </tr>
                        </table>
                    </td>
                </tr>
            </table> 
         </div>
          
         <div id="divNotePopup" style="position:absolute; display:none">
            <table border="0" 
                style="border:2px solid black;font-size:100%; height: 200px; width: 550px; background-color:#ffffff">
                <tr>
                    <td id="tdOperation" align="center" colspan="2"
                        style="color:White;background-color:SteelBlue;font-weight:bold;heigh:25px">
                        Add Note</td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:HiddenField ID="txtID" runat="server" />
                        <asp:Label ID="lblTitle" runat="server" AssociatedControlID="txtTitle">Title</asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtTitle" Width="500px" runat="server" Enabled="true" MaxLength="50" ></asp:TextBox>
                    </td>
                </tr>
                <tr valign=top>
                    <td align="right">
                        <asp:Label ID="lblDescription" runat="server" AssociatedControlID="txtDescription">Description</asp:Label>
                    </td>
                    <td>               
                        <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Rows="5" 
                            Height="300px" Width="500px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2" style="color:Red;">
                        <asp:Label ID="lblErrorMessage" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        <input type="button" id="btnNoteOperation"  value="Save Changes" onclick="javascript:PerformNoteOperation();"/>
                        <input type="button" id="btnNoteCancel"  value="Cancel" onclick="javascript:CancelNoteOperation();" />
                    </td>
                </tr>                    
            </table>
        </div>
     </form>  
</body>
</html>
